/** * com.upyun.api.utils * PolicyUtils.java */package com.hi.hiparty.util;import java.security.MessageDigest;import java.security.NoSuchAlgorithmException;public class UpYunUtils {	public static String signature(String source) {		try {			MessageDigest md = MessageDigest.getInstance("MD5");			md.reset();			md.update(source.getBytes());			byte[] mdbytes = md.digest();			StringBuffer hexString = new StringBuffer();			for (int i = 0; i < mdbytes.length; i++) {				String hex = Integer.toHexString(0xff & mdbytes[i]);				if (hex.length() == 1)					hexString.append('0');				hexString.append(hex);			}			return hexString.toString();		} catch (NoSuchAlgorithmException e) {			e.printStackTrace();		}		return null;	}}